package com.sqsf.aspect;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class LogAspect {

    // 切入点：拦截 UserService 接口下的所有方法
    @Before("execution(* com.sqsf.service.UserService.*(..))")
    public void logServiceMethod(JoinPoint joinPoint) {
        String methodName = joinPoint.getSignature().getName();
        System.out.println("执行了[" + methodName + "]操作");
    }
}
